<template>
	<view class="page-profile">
		<view class="background-wrap">
			<image src="/static/1.jpg" mode="aspectFill" class="background"></image>
			<view class="base-info">
				<text class="name">小可爱</text>
				<image class="avatar" mode="aspectFit" src="https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83ep9htQpB2AmxjTGPlcwjmWdGuc5DRpB0WyPdWFzicnTqTTAJQBnptbhjZdPOXyJTxA8GgynzFLhhlg/132"></image>
			</view>
		</view>
		<view class="actions">
			<view class="want">
				<text class="description">想约</text>
				<text class="amount">100</text>
				<icon class="iconfont icon-heart"></icon>
			</view>
			<view class="done">
				<text class="description">约过</text>
				<text class="amount">80</text>
				<icon class="iconfont icon-oksign"></icon>
			</view>
		</view>
		<view class="key-info">
			<view class="item">
				<text class="label">工号</text>
				<text class="value">XK</text>
			</view>
			<view class="item">
				<text class="label">指数</text>
				<text class="value">666</text>
			</view>
			<view class="item">
				<text class="label">机构</text>
				<text class="value">华润</text>
			</view>
		</view>
		<view class="division"></view>
		<view class="tab-header">
			<view class="item">
				<text class="active">Report</text>
			</view>
			<view class="item">
				<text>Album</text>
			</view>
		</view>
		<view class="tab-content">
			<view class="item">
				<view class="left">
					<view class="content-wrap">
						<text class="content">热度全被抢？范冰冰李晨分手张若昀躺枪成汪峰2.0</text>
					</view>
					<view class="meta-wrap">
						<text>爱吃猫de鱼</text>
						<text>2天前</text>
						<text>30回复</text>
					</view>
				</view>
				<view class="right">
					<image src="https://res.cloudinary.com/dqd7pimc0/image/upload/c_limit,w_1200/sxqzmsmlbpgw9f6vfmo0.jpg" mode="aspectFill" class="picture"></image>
				</view>
			</view>
			<view class="item">
				<view class="left">
					<view class="content-wrap">
						<text class="content">热度全被抢？范冰冰李晨分手张若昀躺枪成汪峰2.0</text>
					</view>
					<view class="meta-wrap">
						<text>爱吃猫de鱼</text>
						<text>2019-05-20</text>
						<text>30回复</text>
					</view>
				</view>
				<view class="right">
					<image src="https://res.cloudinary.com/dqd7pimc0/image/upload/c_limit,w_1200/sxqzmsmlbpgw9f6vfmo0.jpg" mode="aspectFill" class="picture"></image>
				</view>
			</view>
			<view class="item">
				<view class="left">
					<view class="content-wrap">
						<text class="content">热度全被抢？范冰冰李晨分手张若昀躺枪成汪峰2.0</text>
					</view>
					<view class="meta-wrap">
						<text>行尸2016</text>
						<text>2019-05-20</text>
						<text>30回复</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import uniIcon from '@dcloudio/uni-ui/lib/uni-icon/uni-icon.vue'
	import ListOptions from '../../minxins/list-options.js'
	export default {
		data() {
			return {
				page: 'profile',
			};
		},
		mixins: [ListOptions],
		async onLoad(options) {
			this.options = Object.assign({}, this.options, options)
			try {
				let result = await this.fetchPageData()
				this.renderPage(result)
			} catch (error) {
				
			}
		},
		methods: {
			async fetchPageData() {
				let params = this.options;
				if (params.technician_id) {
					params.__resource_id = params.technician_id
					let result = await this.$api.getTechnician(params)
				} else if (params.club_id) {
					params.__resource_id = params.club_id
					let result = await this.$api.getClub(params)
				}
				return result;
			},
			renderPage(result) {
				if (result.ret == 0) {
					
				}
			}
			
		}
	}
</script>

<style lang="scss">
.page-profile {
	.background-wrap {
		position: relative;
		.background {
			height: 38vh;
			width: 100%;
		}
		.base-info {
			display: flex;
			position: absolute;
			bottom: -40upx;
			right: 40upx;
			align-items: center;
			justify-content: flex-end;
			.avatar {
				max-width: 160upx;
				max-height: 160upx;
			}
			.name {
				color: white;
				margin: 30upx;
			}
		}
	}
	.actions {
		display: flex;
		justify-content: center;
		align-content: center;
		width: calc(100% - 200upx);
		.done, .want {
			display: flex;
			flex-grow: 1;
			align-items: center;
			justify-content: center;
			.amount, .description {
			}
			.amount {
				margin: 0 10upx;
			}
			.iconfont {
				font-size: 40upx;
			}
		}
	}
	.key-info {
		display: flex;
		padding: 20upx 0;
		.item {
			display: flex;
			flex-grow: 1;
			justify-content: center;
			align-content: center;
			.label {
				color: #999;
				margin-right: 16upx;
				font-size: 28upx;
				margin-top: 12upx;
			}
			.value {
				font-size: 40upx;
				
			}
		}
	}
	.division {
		width: 100%;
		height: 10upx;
		color:#eee;
		background-color: #eee;
	}
	.tab-header {
		display: flex;
		justify-content: center;
		align-items: center;
		padding: 20upx;
		.item {
			flex-grow: 1;
			display: flex;
			justify-content: center;
			align-content: center;
			.active {
				border-bottom: 4upx solid orange;
			}
		}
		
	}
	.tab-content {
		.item {
			&:not(:last-child) {
				border-bottom: 2upx solid #eee;
			}
			height: 160upx;
			display: flex;
			flex-direction: row;
			padding: 20upx 30upx;
			.left {
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				.meta-wrap {
					text {
						font-size: 28upx;
						color: #aaa;
						margin-right: 10upx;
					}
				}
			}
			.right {
				margin-left: 20upx;
				.picture {
					width: 240upx;
					height: 160upx;
				}
			}
		}
		
	}
}
 </style>
